# coding=utf8

all_file = '../data/validate_n1.txt'
category_file = '../data/category_30.txt'
train_p_file = '../data/validate_n.txt'


all_lines = open(all_file).readlines()
category_lines = [line.split('\t:\t')[0] for line in open(category_file).readlines()]

with open(train_p_file, 'w') as f:
    for line in all_lines:
        if line.split('\t:\t')[0] in category_lines:
            f.write(line)
